package com.banmao.mall.mapper;

import com.banmao.mall.model.pojo.Admin;
import com.banmao.mall.model.vo.admin.DashboardVO;
import com.banmao.mall.model.vo.admin.system.AdminListVO;
import com.banmao.mall.model.vo.admin.system.ItemsBean;
import org.apache.ibatis.annotations.Param;

import javax.annotation.security.PermitAll;
import java.util.List;

public interface AdminMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    Admin selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    Admin selectLoginAdminByUsername(String username);

    Admin selectInfoByID(Integer adminId);

    String selectRolesByRolesID(String roleId);

    List<String> selectPermByRoleID(String roleId);


    List<ItemsBean> selectAdminIdList(@Param("page") Integer page, @Param("limit") Integer limit, @Param("sort") String sort, @Param("order") String order,@Param("username") String username);

    Integer selectAdminTotal(@Param("page") Integer page, @Param("limit") Integer limit, @Param("sort") String sort, @Param("order") String order,@Param("username") String username);

    String selectUsernameByID(Integer adminId);

    int updatePassword(@Param("adminId") Integer adminId, @Param("newPassword") String newPassword);

    String selectOldPassword(Integer adminId);

}